package com.itheima.health.config;

import com.itheima.health.util.AliOsssUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author aft
 * @version 1.0
 * @date 2023/4/22 21:38
 */
@Configuration
@Slf4j
public class OssConfiguration {

    @Bean
    public AliOsssUtil aliOssUtil(AliOsssProperties aliOsssProperties){
        log.info("开始进行文件上传工具类的创建...");
        AliOsssUtil aliOssUtil = new AliOsssUtil(
                aliOsssProperties.getEndpoint(),
                aliOsssProperties.getAccessKeyId(),
                aliOsssProperties.getAccessKeySecret(),
                aliOsssProperties.getBucketName());
        return aliOssUtil;
    }

}
